package com.bff.bjj.musicobjects;

/**
 * Represents an album.
 * 
 * @author Bill Findeisen
 * @version 1.0
 */
public class BJJAlbum extends BJJPlayableItem {

    private String artist;
    private String year;
    private String artworkTrackId;
    private boolean compilation;

    /**
     * Default constructor
     */
    public BJJAlbum() {
        super();
    }

    /**
     * Constructor   
     * @param id album id
     * @param name album name
     */
    public BJJAlbum(String id, String name) {
        super(id, name);
    }

    /**
     * Constructor
     * @param id album id
     * @param name album name
     * @param artist artist name
     */
    public BJJAlbum(String id, String name, String artist) {
        super(id, name);
        this.artist = artist;
    }

    /**
     * Return the artist of the album
     * Check for null and use the database to get the artist if necessary.
     * There is a performance problem in loading the artist with the album
     * call sometimes.
     * @return the artist
     */
    public String getArtist() {
        return artist;
    }

    /**
     * Sets the artist for this album
     * @param artist the artist
     */
    public void setArtist(String artist) {
        this.artist = artist;
    }

    @Override
    public boolean equals(Object object) {
        return super.equals(object);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    /**
     * @return the year
     */
    @Override
    public String getYear() {
        return year;
    }

    @Override
    public String toString() {
        return getName();
    }

    /**
     * @param year the year to set
     */
    @Override
    public void setYear(String year) {
        this.year = year;
    }

    /**
     * @return the artworkTrackId
     */
    public String getArtworkTrackId() {
        return artworkTrackId;
    }

    /**
     * @param artworkTrackId the artworkTrackId to set
     */
    public void setArtworkTrackId(String artworkTrackId) {
        this.artworkTrackId = artworkTrackId;
    }

    public boolean isCompilation() {
        return compilation;
    }

    public void setCompilation(boolean compilation) {
        this.compilation = compilation;
    }

    @Override
    public int getLength() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void setAlbum() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getTitle() {
        return getName();
    }
}
